'$DEFINE DEBUG ''Define for script development/debugging
'$INCLUDE 'setupapi.inc'
'$INCLUDE 'msdetect.inc'
''Dialog ID's
CONST WELCOME = 100
CONST ASKQUIT = 200
CONST ASKQUITNOTHING= 201
CONST ASKQUITNOPROD = 202
CONST ASKEXISTSDIR = 210
CONST ASKEXISTSPROD = 220
CONST ASKEXISTSWIN = 230
CONST DESTPATH = 300
CONST EXITFAILURE = 400
CONST EXITQUIT = 600
CONST EXITSUCCESSPROD = 700
CONST EXITSUCCESSVFW= 701
CONST EXITSUCCESSNMS= 702
CONST PRODHELP = 900
CONST SIGNBOARD1 = 2001
CONST SIGNBOARD2 = 2002
CONST SIGNBOARD3 = 2003
CONST SIGNBOARD4 = 2004
CONST SIGNBOARD5 = 2005
CONST SIGNBOARD6 = 2006
CONST CUSTINST = 6200
CONST TOOBIG = 6300
CONST BADPATH = 6400
CONST MINREQUIRED = 6500
CONST RESTART = 7900
CONST RESTARTII = 8000
CONST INSTALLVFW = 9000
''Bitmap IDs
CONST IDC_BM0 = 600
CONST IDC_BM1 = 601
''Icon IDs
CONST IDC_ICON6 = 506
CONST IDC_ICON7 = 507
''File Types
CONST PROD = 1
CONST VID = 2
CONST NMS = 3
'' actual amount plus 10%
CONST PRODCOST = 10316724
CONST VIDCOST = 2329118
CONST NMSCOST = 11354112
CONST DISPLAYPATHLEN = 40 '' Length limit for display of path in Custom Installation
GLOBAL CUIDLL$
GLOBAL szSaveProdDir$
GLOBAL SrcDir$
GLOBAL WinDir$
GLOBAL WinSysDir$
GLOBAL DEST$ '' Default destination directory.
GLOBAL WINDRIVE$ '' Windows drive letter.
GLOBAL szFound$ '' found filespec
''CustInst list symbol names
GLOBAL PRODFILES$
GLOBAL VIDFILES$
GLOBAL NMSFILES$
'' already installed booleans
GLOBAL bProdInstalled%
GLOBAL bVfwInstalled%
GLOBAL bNmsInstalled%
GLOBAL cost&
GLOBAL cost1&
GLOBAL free&
GLOBAL free1&
GLOBAL CursorSave%
''Dialog list symbol names
GLOBAL CHECKSTATES$
GLOBAL STATUSTEXT$
GLOBAL DRIVETEXT$
GLOBAL REQUIREDTEXT$
GLOBAL HDLIST$
GLOBAL INSTALLTEXT$
'' defined functions
DECLARE SUB AddOptFilesToCopyList (ftype%)
DECLARE SUB RecalcOptFiles (ftype%)
DECLARE SUB RecalcPath
DECLARE SUB SetDriveStatus
DECLARE FUNCTION MakePath(szDir$, szFile$) AS STRING
DECLARE SUB CheckForPROD(szPRODDir$)
Declare Function TruncateToLengthOrLess(szSrcStr$, nLength%) As String
Declare Function GetProcessor() As Integer
Declare Function MeetsMinRequired() As Integer
Declare Function RemoveSlash (szDir$) As String
Declare Function MakeDirPath (szDir$) As String
Declare Function IsDriverInstalled(szFile$) As String
Declare Sub CheckVfWOverwrite
Declare Sub AskQuitSub
Declare Sub ModifyIniVFW
Declare Sub ModifyIniAnimation
Declare Sub InstallProdGroup
'' external procedures
Declare Function MaximizeWindow LIB "dlgprocs.dll" (hwnd%) As Integer
Declare Function DoMemManInfo LIB "dlgprocs.dll" (item%) As Integer
Declare Function SetTo256Min LIB "dlgprocs.dll" () As Integer
Declare Function GetVerInfo LIB "dlgprocs.dll" (szPath$, szVer$, Product%) As Integer
Declare Function DoVFWIniFiles LIB "dlgprocs.dll" () As Integer
DECLARE FUNCTION GetModuleHandle LIB "kernel" (szModName$) AS INTEGER
DECLARE FUNCTION VflatdPresent LIB "iniupd.DLL" AS INTEGER
DECLARE FUNCTION ExitWindowsExec LIB "User" (Exec$, Param$) AS INTEGER
''Declare Function sndPlaySound Lib "MMSystem" (lpsound As Any, flag As Integer) As Integer
Declare Function waveOutGetNumDevs Lib "MMSystem" () As Integer
''Declare Function GetDC Lib "User" (hWnd%) As Integer
''Declare Function GetDeskTopWindow Lib "User" () As Integer
''Declare Function GetDeviceCaps Lib "GDI" (hDC%, nIndex%) As Integer
DECLARE FUNCTION GetPrivateProfileString LIB "Kernel" (lpApplicationName As String, lpKeyName As String, lpDefault As String, lpReturnedString As String, nSize As Integer, lpFileName As String) As Integer
Declare Function GlobalCompact Lib "kernel" (flag&) As Long
Declare Function GetFreeSpace Lib "kernel" (flag%) As Long
Declare Function GetFreeSystemResources Lib "User" (fuSysResource As Integer) As Integer
''Declare Function ReleaseDC Lib "User" (hWnd As Integer, hDC As Integer) As Integer
Const SM_MOUSEPRESENT = 19
INIT:
szSaveProdDir$ = ""
''Disk cost list symbols
PRODFILES$ = "Product"
VIDFILES$ = "VfW Runtime"
NMSFILES$ = "NMS Files"
CUIDLL$ = "dlgprocs.dll" '' custom user interface dll
HELPPROC$ = "FHelpDlgProc" '' Help dialog procedure
hwnd% = HwndFrame()
i% = MaximizeWindow(hwnd%) '' maximize the main window